package com.yunhe.policyfulfillment.authority.repository;

import com.yunhe.policyfulfillment.authority.domain.PolicyMenu;
import com.yunhe.policyfulfillment.authority.domain.PolicyRoleAndMenuRelation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author zhengbo
 * @date 2021/9/18 10:32
 */
@Repository
public interface PolicyRoleAndMenuRelationRepository {

    /**
     * 新增
     * @author zb
     * @date 2021/09/18
     **/
    int createPolicyRoleAndMenuRelationSelective(PolicyRoleAndMenuRelation policyRoleAndMenuRelation);

    /**
     * 根据角色id删除
     * @param roleId 角色id
     */
    void deletePolicyMenusByRoleId(@Param("roleId") Long roleId);

    /**
     * 根据菜单id删除
     * @param menuId 菜单id
     */
    void deletePolicyMenusByMenuId(@Param("menuId") Long menuId);

    /**
     * 根据角色id查询菜单列表
     * @param roleId 角色id
     * @return List<PolicyMenu>
     */
    List<PolicyMenu> searchPolicyMenusByRoleId(@Param("roleId") Long roleId);

}
